----------------------------------------------------------------------------------
-- Company: 		 Johns Hopkins University
-- Engineer: 		 Kevin Green
-- 
-- Create Date:    23:55:24 11/29/2011 
-- Design Name:    lut_5
-- Module Name:    lut_5 - RTL 
-- Project Name:   top_gillis_green
-- Target Devices: 
-- Tool versions: 
-- Description:    This is the 5-bit look-up table.  Given a the black and white
--                 vector and player, an output vector with the possible valid
--                 moves is generated.
--
-- Dependencies: 
--
-- Revision: 
-- Revision 0.01 - File Created
-- Additional Comments: 
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity lut_5 is
    Port ( black : in  STD_LOGIC_VECTOR (7 downto 0);
           white : in  STD_LOGIC_VECTOR (7 downto 0);
           player : in  STD_LOGIC;
           data_out : out  STD_LOGIC_VECTOR (7 downto 0));
end lut_5;

architecture RTL of lut_5 is

begin

process(player, black, white) is
begin
		case player & black & white is
			when '0' & x"0102" => data_out <= x"04";
			when '0' & x"0106" => data_out <= x"08";
			when '0' & x"010a" => data_out <= x"04";
			when '0' & x"010e" => data_out <= x"10";
			when '0' & x"0112" => data_out <= x"04";
			when '0' & x"0116" => data_out <= x"08";
			when '0' & x"011a" => data_out <= x"04";
			when '1' & x"0201" => data_out <= x"04";
			when '0' & x"0204" => data_out <= x"08";
			when '1' & x"0204" => data_out <= x"01";
			when '0' & x"0205" => data_out <= x"08";
			when '1' & x"0209" => data_out <= x"04";
			when '0' & x"020c" => data_out <= x"10";
			when '1' & x"020c" => data_out <= x"01";
			when '0' & x"020d" => data_out <= x"10";
			when '1' & x"0211" => data_out <= x"04";
			when '0' & x"0214" => data_out <= x"08";
			when '1' & x"0214" => data_out <= x"01";
			when '0' & x"0215" => data_out <= x"08";
			when '1' & x"0219" => data_out <= x"04";
			when '1' & x"021c" => data_out <= x"01";
			when '0' & x"0304" => data_out <= x"08";
			when '0' & x"030c" => data_out <= x"10";
			when '0' & x"0314" => data_out <= x"08";
			when '0' & x"0402" => data_out <= x"01";
			when '1' & x"0402" => data_out <= x"08";
			when '1' & x"0403" => data_out <= x"08";
			when '0' & x"0408" => data_out <= x"10";
			when '1' & x"0408" => data_out <= x"02";
			when '0' & x"0409" => data_out <= x"10";
			when '1' & x"0409" => data_out <= x"02";
			when '0' & x"040a" => data_out <= x"11";
			when '0' & x"040b" => data_out <= x"10";
			when '0' & x"0412" => data_out <= x"01";
			when '1' & x"0412" => data_out <= x"08";
			when '1' & x"0413" => data_out <= x"08";
			when '1' & x"0418" => data_out <= x"02";
			when '1' & x"0419" => data_out <= x"02";
			when '0' & x"041a" => data_out <= x"01";
			when '1' & x"0502" => data_out <= x"08";
			when '0' & x"0508" => data_out <= x"10";
			when '1' & x"0508" => data_out <= x"02";
			when '0' & x"050a" => data_out <= x"10";
			when '1' & x"0512" => data_out <= x"08";
			when '1' & x"0518" => data_out <= x"02";
			when '1' & x"0601" => data_out <= x"08";
			when '0' & x"0608" => data_out <= x"10";
			when '1' & x"0608" => data_out <= x"01";
			when '0' & x"0609" => data_out <= x"10";
			when '1' & x"0611" => data_out <= x"08";
			when '1' & x"0618" => data_out <= x"01";
			when '0' & x"0708" => data_out <= x"10";
			when '0' & x"0804" => data_out <= x"02";
			when '1' & x"0804" => data_out <= x"10";
			when '0' & x"0805" => data_out <= x"02";
			when '1' & x"0805" => data_out <= x"10";
			when '0' & x"0806" => data_out <= x"01";
			when '1' & x"0806" => data_out <= x"10";
			when '1' & x"0807" => data_out <= x"10";
			when '1' & x"0810" => data_out <= x"04";
			when '1' & x"0811" => data_out <= x"04";
			when '1' & x"0812" => data_out <= x"04";
			when '1' & x"0813" => data_out <= x"04";
			when '0' & x"0814" => data_out <= x"02";
			when '0' & x"0815" => data_out <= x"02";
			when '0' & x"0816" => data_out <= x"01";
			when '0' & x"0902" => data_out <= x"04";
			when '0' & x"0904" => data_out <= x"02";
			when '1' & x"0904" => data_out <= x"10";
			when '1' & x"0906" => data_out <= x"10";
			when '1' & x"0910" => data_out <= x"04";
			when '0' & x"0912" => data_out <= x"04";
			when '1' & x"0912" => data_out <= x"04";
			when '0' & x"0914" => data_out <= x"02";
			when '1' & x"0a01" => data_out <= x"04";
			when '1' & x"0a04" => data_out <= x"11";
			when '1' & x"0a05" => data_out <= x"10";
			when '1' & x"0a10" => data_out <= x"04";
			when '1' & x"0a11" => data_out <= x"04";
			when '1' & x"0a14" => data_out <= x"01";
			when '1' & x"0b04" => data_out <= x"10";
			when '1' & x"0b10" => data_out <= x"04";
			when '0' & x"0c02" => data_out <= x"01";
			when '1' & x"0c02" => data_out <= x"10";
			when '1' & x"0c03" => data_out <= x"10";
			when '1' & x"0c10" => data_out <= x"02";
			when '1' & x"0c11" => data_out <= x"02";
			when '0' & x"0c12" => data_out <= x"01";
			when '1' & x"0d02" => data_out <= x"10";
			when '1' & x"0d10" => data_out <= x"02";
			when '1' & x"0e01" => data_out <= x"10";
			when '1' & x"0e10" => data_out <= x"01";
			when '0' & x"1008" => data_out <= x"04";
			when '0' & x"1009" => data_out <= x"04";
			when '0' & x"100a" => data_out <= x"04";
			when '0' & x"100b" => data_out <= x"04";
			when '0' & x"100c" => data_out <= x"02";
			when '0' & x"100d" => data_out <= x"02";
			when '0' & x"100e" => data_out <= x"01";
			when '0' & x"1102" => data_out <= x"04";
			when '0' & x"1106" => data_out <= x"08";
			when '0' & x"1108" => data_out <= x"04";
			when '0' & x"110a" => data_out <= x"04";
			when '0' & x"110c" => data_out <= x"02";
			when '1' & x"1201" => data_out <= x"04";
			when '0' & x"1204" => data_out <= x"08";
			when '1' & x"1204" => data_out <= x"01";
			when '0' & x"1205" => data_out <= x"08";
			when '0' & x"1208" => data_out <= x"04";
			when '0' & x"1209" => data_out <= x"04";
			when '1' & x"1209" => data_out <= x"04";
			when '1' & x"120c" => data_out <= x"01";
			when '0' & x"1304" => data_out <= x"08";
			when '0' & x"1308" => data_out <= x"04";
			when '0' & x"1402" => data_out <= x"01";
			when '1' & x"1402" => data_out <= x"08";
			when '1' & x"1403" => data_out <= x"08";
			when '1' & x"1408" => data_out <= x"02";
			when '1' & x"1409" => data_out <= x"02";
			when '0' & x"140a" => data_out <= x"01";
			when '1' & x"1502" => data_out <= x"08";
			when '1' & x"1508" => data_out <= x"02";
			when '1' & x"1601" => data_out <= x"08";
			when '1' & x"1608" => data_out <= x"01";
			when '0' & x"1804" => data_out <= x"02";
			when '0' & x"1805" => data_out <= x"02";
			when '0' & x"1806" => data_out <= x"01";
			when '0' & x"1902" => data_out <= x"04";
			when '0' & x"1904" => data_out <= x"02";
			when '1' & x"1a01" => data_out <= x"04";
			when '1' & x"1a04" => data_out <= x"01";
			when '0' & x"1c02" => data_out <= x"01";
			when others => data_out <= (others => '0');
		end case;
end process;

end RTL;

